#ifndef _GAME_LOGIC_H_
#define _GAME_LOGIC_H_

#include <stdio.h>
#include "mj.h"
#include "deck.h"
#include "hole_mjs.h"
#include "form_mjs.h"
#include "out_mjs.h"

//基础牌型判断
int logic_check_qing_yi_se(HoleMjs &holes, FormMjs &forms, OutMjs &outs); //检查清一色
int logic_check_qidui(HoleMjs &holes, FormMjs &forms, OutMjs &outs);	//检查七对
int logic_check_pengpenghu(HoleMjs &holes, FormMjs &forms, OutMjs &outs); //检查碰碰胡
int logic_check_dandiao(HoleMjs &holes, FormMjs &forms, OutMjs &outs);	//检查单吊
int logic_check_tianhu(HoleMjs &holes, FormMjs &forms, OutMjs &outs); 	//检查天胡


//胡牌牌型，基础算法
bool hupai_base(int *pi_mj, int i_num, int *pi_select);
//碰碰胡，基础胡牌算法
int pengpenghu_base(int *pi_mj, int i_num, int *pi_select);
//3n+2 张牌能否胡牌牌型
bool check_hupai(std::vector<Mj> mjs, int dq_val);
//检查7小对
bool seven_double_hupai(int *pi_mj, int i_num, int *pi_select);

//检查是否叫牌
bool check_ting(std::vector<Mj> v_mjs, int dq_val);
//检查报听
bool check_baoting(std::vector<Mj> mjs, std::vector<int> &ting_out_mjval, int dq_val);


//检查叫胡那些牌
bool get_tinghu_mjs(std::vector<Mj> v_mjs, std::vector<int> &v_ting);

//从mjs中, 删除n个相同的mj
int remove_n_mj(std::vector<Mj> &mjs, Mj &mj, int cnt);

//从mjs中, 计算mj的个数
int get_one_mj_num(std::vector<Mj> &mjs, Mj mj);






#endif

